-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoplay detection: fix fullscreen issue on iOS #11822
Autoplay detection: fix fullscreen issue on iOS #11822
Conversation
const version = navigator.userAgent.match(/iPhone OS (\d+)_(\d+)/) | ||
if (version !== null && parseInt(version[1]) < 17 && !navigator.userAgent.includes('Safari')) { | ||
// skip autodetection on iOS 16 WebView | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This return is not in a function and fails the linter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops my bad, thanks for pointing this out! I'm used to TypeScript + Webpack taking care of this automatically for me, and did not take the time to test it locally on Prebid 😅 I'll fix this tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed the code and rebased on master, it's all good now @patmmccann 👍
1bdeae6
to
9f041df
Compare
cf8fea2
to
c3c037a
Compare
* Improve autoplay detection to fix fullscreen issue on iOS * Skip autodetection on WebView on iOS < 17
* Ignore NotSupportedError exceptions in autoplay detection This error is caused by a Content Security Policy that disables data: scheme for media URLs. Before this PR, this error would cause autoplay to be disabled; now, if this error is raised it has the same effect as disabling autoplay detection. * Remove warning that has been addressed by #11822
Type of change
Description of change
This PR improves the autoplay detection to prevent the video from going fullscreen if autoplay succeeds.
Other information